<?php
if (!defined('WEB_ROOT')) {
	exit;
}

// make sure a paper id exists
if (isset($_GET['id']) && $_GET['id'] > 0) {
	$id = (int)$_GET['id'];
} else {
	// redirect to index.php if product id is not present
	header('Location: index.php');
}

$sql = "SELECT bb.id, mabb, tenbb, tomtat_bb, noidung_bb, ngaydang, khoi_id, tenkhoi, tentc, cttc.so, cttc.ngayra, tutrang, dentrang
        FROM baibao bb left join khoi k on bb.khoi_id = k.id left join chitiet_tapchi cttc on bb.cttc_id = cttc.id left join tapchi tc on cttc.tc_id = tc.id
		WHERE bb.id = $id";

$result = mysql_query($sql) or die('Cannot get paper. ' . mysql_error());
$row    = mysql_fetch_assoc($result);
extract($row);
?>
<div class="onecolumn">
				<div class="header">
					<span>Thông tin bài báo</span>
				</div>
				<br class="clear"/>
				<div class="content">
					<form action="processPaper.php?action=addPaper" method="post" enctype="multipart/form-data" name="frmAddPaper" id="frmAddPaper">
					 <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" class="entryTable">
					  <tr> 
					   <td width="78" class="label">Mã bài báo</td>
					   <td colspan="5" class="content"><?php echo $mabb; ?></td>
					  </tr>
					  <tr> 
					   <td width="78" class="label">Tiêu đề bài báo</td>
					   <td colspan="5" class="content"> <b><?php echo $tenbb; ?></b></td>
					  </tr>
					  <tr> 
					   <td width="78" class="label">Tóm tắt bài báo</td>
					   <td colspan="5" class="content"><?php echo $tomtat_bb; ?> </td>
					  </tr>
					  <tr> 
					   <td width="78" class="label">Khối ngành</td>
					   <td colspan="5" class="content"><?php echo $tenkhoi; ?> </td>
					  </tr>
					  <tr> 
					   <td width="78" height="36" class="label">Đăng trên tạp chí</td>
					   <td colspan="5" class="content"><?php echo $tentc.' số ',$so; ?> </td>
					  </tr>
					  <tr> 
					   <td width="150" class="label">Ngày đăng</td> <td width="131" class="content"><?php echo $ngaydang; ?> </td>
					
					   <td width="100" class="label">Từ trang </td>
					   <td width="100" class="content"><?php echo $tutrang; ?></td>
					   <td width="100" class="label">Đến trang </td>
					   <td width="100" class="content"><?php echo $dentrang; ?></td>
					  </tr>
						<tr> 
						   <td width="78" class="label">Nội dung bài báo</td>
						   <td colspan="9" class="content"><?php echo $noidung_bb; ?></td>
					  </tr>
					 </table>
					 <p align="center"> 
					  <input name="btnModifyProduct" type="button" id="btnModifyPaper" value="Sửa bài báo" onClick="window.location.href='index.php?view=modify&id=<?php echo $id; ?>&khoi_id=<?php echo $khoi_id; ?>';" class="box">
					  &nbsp;&nbsp;
					  <input name="btnBack" type="button" id="btnBack" value=" Trở lại " onClick="window.history.back();" class="box">
					  <input name="btnBack" type="button" id="btnBack" value=" Xem nội dung bài báo " onClick="window.location.href='index.php?view=detail&id=<?php echo $id; ?>';" class="box">
					 </p>
					</form>
				</div>
			</div>
